﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title – MVC 5 Shopping Cart</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
        <a class="navbar-brand" href="/">Eugene Shop</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarText">
            <ul class="navbar-nav mr-auto">

                @Html.Action("PagesMenuPartial", "Pages")

                @if (Request.IsAuthenticated)
                {
                    <li> @Html.ActionLink("Logout", "Logout", "Account", null, new { @class = "navbar-text", style = "text-decoration: none" }) @*<a href="/account/logout">Logout</a>*@ </li>
                }
                else
                {
                    if (ViewBag.Title == "Login")
                    {
                        <li class="navbar-text"> @Html.ActionLink("Login", "Login", "Account", null, new { @class = "active", style = "text-decoration: none" }) </li>
                    }
                    else
                    {
                        <li> @Html.ActionLink("Login", "Login", "Account", null, new { @class = "navbar-text", style = "text-decoration: none" }) </li>
                    }
                }

                @if (Request.IsAuthenticated && User.IsInRole("User"))
                {
                    if (ViewBag.Title == "User Profile")
                    {
                        <li class="active"> @Html.Action("UserNavPartial", "Account", new { area = "" }) </li>
                    }
                    else
                    {
                        <li> @Html.Action("UserNavPartial", "Account", new { area = "" }) </li>
                    }
                }
                <!--**********************-->
            </ul>

            @if (Request.IsAuthenticated && User.IsInRole("Admin"))
            {
                <span class="navbar-text">
                    @Html.ActionLink("Admin Area", "Index", "Dashboard", new { area = "Admin" }, null)
                </span>
            }
            else
            {
                if (ViewBag.Title != "Cart Details")
                {
                    <span class="navbar-text">
                        @Html.Action("CartPartial", "Cart")
                    </span>
                }
            }
        </div>
    </nav>

    
    <div class="container body-content" style="margin-top: 30px;">
        <div class="row">
            
            
            <div class="col-sm-12 col-md-3 list-group">
                @Html.Action("CategoryMenuPartial", "Shop")
            </div>
            
            <!--*****************-->

            @if (ViewBag.Sidebar == "Yes")
            {
                <div class="col">
                    @RenderBody()
                </div>

                <div class="col-sm-12 col-md-3">
                    @Html.Action("SidebarPartial", "Pages")
                </div>
            }
            else
            {
                <div class="col">
                    @RenderBody()
                </div>
            }


        </div>


        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year – Eugene Shop</p>
        </footer>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/scripts")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>
